{layout name="layout" /}
<!-- Imported scripts on this page -->
<script src="/static/js/rwd-table/js/rwd-table.min.js"></script>
<script src="/static/js/datatables/js/jquery.dataTables.min.js"></script>
<!-- <link rel="stylesheet" href="/static/css/xenon-forms.css"> -->
<!-- Imported scripts on this page -->
<script src="/static/js/datatables/dataTables.bootstrap.js"></script>
<script src="/static/js/datatables/yadcf/jquery.dataTables.yadcf.js"></script>
<script src="/static/js/datatables/tabletools/dataTables.tableTools.min.js"></script>
<div class="page-title">

    <div class="breadcrumb-env pull-left">

        <ol class="breadcrumb bc-1">
            <li>
                <a href="{:url('Index/index')}"><i class="fa-home"></i>首页</a>
            </li>
            <li>
                <a href="">员工管理</a>
            </li>
            <li class="active">
                <strong>员工列表</strong>
            </li>
        </ol>

    </div>
</div>
<div class="row">
    <div class="col-md-12">

        <!-- ******************************************************************************************************** -->
        <!-- Removing search and results count filter -->
        <div class="panel panel-default">
            <div class="panel-heading btn-toolbar">
                <!-- <h3 class="panel-title">员工列表</h3> -->
                <div class="btn-group focus-btn-group">
                    <button class="btn btn-default btn-primary">
                        <span class="fa-plus"></span> 添 加
                    </button>
                </div>
                <div class="btn-group dropdown-btn-group pull-right">
                    <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">过滤某列数据
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu">
                        <li class="checkbox-row">
                            <div class="cbr-replaced cbr-checked">
                                <div class="cbr-input">
                                    <input type="checkbox" name="toggle-id916bcee584545-col-1"
                                           id="toggle-id916bcee584545-col-1" value="id916bcee584545-col-1"
                                           class="cbr cbr-done"></div>
                                <div class="cbr-state">
                                    <span></span>
                                </div>
                            </div>
                            <label for="toggle-id916bcee584545-col-1">用户名</label>
                        </li>
                    </ul>
                    <button class="btn btn-default">导出</button>
                </div>
            </div>
            <div class="panel-body">
                <div class="btn-toolbar">
                    <div class="form-inline" style="margin-bottom:15px;" class="search-tool">
                            <span>
                                <label class="control-label">姓名</label>   
                                <input type="text" class="form-control" placeholder="姓名">
                            </span>
                        <span style="margin-left: 15px;">
                                <label class="control-label">手机号</label>      
                                <input type="text" class="form-control" placeholder="手机号">
                            </span>
                        <span style="margin-left: 15px;">
                                <label class="control-label">角色</label>
                                <select class="form-control">
                                    <option>管理员</option>
                                    <option>Option 2</option>
                                </select>
                            </span>
                        <span style="margin-left: 15px;">
                                <label class="control-label">部门</label>
                                <select class="form-control">
                                    <option>制造部</option>
                                    <option>Option 2</option>
                                </select>   
                            </span>
                        <span style="margin-left: 15px;">
                                <button class="btn btn-default btn-primary" style="margin-top:10px;">
                                    <span class="fa-search"></span> 搜 索
                                </button> 
                            </span>
                    </div>
                </div>
                <script type="text/javascript">
                    jQuery(document).ready(function ($) {
                        $("#example-2").dataTable({
                            dom: "t" + "<'row'<'col-xs-6'i><'col-xs-6'p>>",
                            dom: "t" + "<'row'<'col-xs-6'><'col-xs-6'>>",
                            aoColumns: [
                                {bSortable: false},
                                null,
                                null,
                                null,
                                null,
                                null,
                                null
                            ],
                        });

                        // Replace checkboxes when they appear
                        var $state = $("#example-2 thead input[type='checkbox']");

                        $("#example-2").on('draw.dt', function () {
                            cbr_replace();

                            $state.trigger('change');
                        });

                        // Script to select all checkboxes
                        $state.on('change', function (ev) {
                            var $chcks = $("#example-2 tbody input[type='checkbox']");

                            if ($state.is(':checked')) {
                                $chcks.prop('checked', true).trigger('change');
                            } else {
                                $chcks.prop('checked', false).trigger('change');
                            }
                        });
                    });
                </script>

                <table class="table table-bordered table-striped" id="example-2">
                    <thead>
                    <tr>
                        <th class="no-sorting">
                            <input type="checkbox" class="cbr">
                        </th>
                        <th>用户名</th>
                        <th>真实姓名</th>
                        <th>电话</th>
                        <th>邮箱</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>

                    <tbody class="middle-align">

                    {volist name='list' id='user'}
                    <tr>
                        <td>
                            <input type="checkbox" class="cbr">
                        </td>
                        <td> {$user.username}</td>
                        <td> {$user.truename}</td>
                        <td> {$user.phone}</td>
                        <td> {$user.eamil}</td>
                        <td> {$user.status==0?'正常':'禁用'}</td>
                        <td>
                            <a href="#" class="btn btn-secondary btn-sm btn-icon icon-left">
                                编辑
                            </a>

                            <a href="#" class="btn btn-danger btn-sm btn-icon icon-left">
                                删除
                            </a>
                        </td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
                <div class="row">
                    <div class="col-xs-6">
                        <div class="dataTables_info" id="example-3_info" role="status" aria-live="polite"> 共{:count(
                            $list ) } 行数据
                        </div>
                    </div>
                    <div class="col-xs-6">
                        <div class="dataTables_paginate paging_simple_numbers" id="example-3_paginate">
                            {$list->render()}
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- *********************************************************************************************************************** -->
